package entity;

import static javax.persistence.GenerationType.IDENTITY;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Klasa Players povezuje entitet PLAYERS u bazi podataka i sinhronizuje
 * 
 * @author rigo
 *
 */
@Entity
@Table(name="PLAYERS")
public class Players implements Serializable{
	private static final long serialVersionUID = 8802267236028325114L;

	@Id
	@GeneratedValue(strategy=IDENTITY) 
	@Column(name="PL_ID", unique=true, nullable=false)
	protected Integer playersId;

	@ManyToOne	
	@JoinColumn(name="AP_ID", referencedColumnName="AP_ID", nullable=false)
	protected Appointment appointment;
	
	@ManyToOne	
	@JoinColumn(name="US_ID", referencedColumnName="US_ID", nullable=false)
	protected User user;
	
	@Column(name="PL_TEAM", unique=false, nullable=true)
	protected Character team;
	
	@Column(name="PL_MVP", unique=false, nullable=true)
	protected Integer mvp;
	
	@Column(name="PL_VOTE", unique=false, nullable=true)
	protected Boolean vote;	
	
	@Column(name="PL_GOAL", unique=false, nullable=true)
	protected Integer goal;

	@Column(name="PL_PARTICIPATED", unique=false, nullable=true)
	protected Boolean participated;

	public Integer getPlayersId() {
		return playersId;
	}

	public Appointment getAppointment() {
		return appointment;
	}

	public User getUser() {
		return user;
	}

	public Character getTeam() {
		return team;
	}

	public Integer getMvp() {
		return mvp;
	}

	public Boolean getVote() {
		return vote;
	}

	public Integer getGoal() {
		return goal;
	}

	public Boolean getParticipated() {
		return participated;
	}

	public void setPlayersId(Integer playersId) {
		this.playersId = playersId;
	}

	public void setAppointment(Appointment appointment) {
		this.appointment = appointment;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public void setTeam(Character team) {
		this.team = team;
	}

	public void setMvp(Integer mvp) {
		this.mvp = mvp;
	}

	public void setVote(Boolean vote) {
		this.vote = vote;
	}

	public void setGoal(Integer goal) {
		this.goal = goal;
	}

	public void setParticipated(Boolean participated) {
		this.participated = participated;
	}
	
	
}
